const md = require('../../utils/md5.js');
const app = getApp();
const post = require('../../utils/post.js');
Page({

  data: {
  
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that =this;
    console.log(options);
    if(options.type){
      wx.setNavigationBarTitle({
        title: '服务门店',
      });
      that.setData({
        isshop:1,
        depname:options.depname?options.depname:"",
        address:options.address!='null'?options.address:""
      })
    }
    if(options.id){
      var datas = {};
      datas.where = "MebID = "+options.id;
      var datacall = function (res) {
        console.log(res);
        if(res.data.data.length >0){
         // var star =res.data.data[0].StarLevel;
          that.setData({
            frinfo: res.data.data[0],
            star:4,
            starnone:1
          })
        }
      }
      var res2 = post.getdata("/BO/BA_Member/Query", datas, datacall);
    }
  },
  call: function () {
    var that = this;
    wx.makePhoneCall({
      phoneNumber: that.data.frinfo.Tel,
      success: function (res) { },
      fail: function (res) { },
      complete: function (res) { },
    })
  },
})